//
//  NameCellTextFieldDelegate.m
//  IWeighMyself
//
//  Created by Francisco Gindre on 8/7/10.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import "NameCellTextFieldDelegate.h"


@implementation NameCellTextFieldDelegate
@synthesize userViewController;
-(id)initWithNewUserViewController:(NewUserViewController*)newUserViewController {
	self = [super init];
	
	self.userViewController = newUserViewController;
	[self.userViewController retain];
	return self;
	
}
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
	[textField resignFirstResponder];
	/*
	 update cell values on settings screen with keyboard entry
	 */
	
	[[userViewController.cellValues objectAtIndex:userViewController.nameCellIndexPath.section] 
	 replaceObjectAtIndex:userViewController.nameCellIndexPath.row withObject:textField.text];
	
	
	
	return YES;
}
@end
